package com.wendy.thirdpartyaccess.wechat;

import com.wendy.thirdpartyaccess.SocialConstants;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.social.config.annotation.ConnectionFactoryConfigurer;
import org.springframework.social.config.annotation.SocialConfigurerAdapter;

/**
 * @author zhuwending
 */
@Configuration
public class WechatAutoConfiguration extends SocialConfigurerAdapter {

    @Override
    public void addConnectionFactories(ConnectionFactoryConfigurer configurer, Environment environment) {
        configurer.addConnectionFactory(new WechatConnectionFactory("wechat", SocialConstants.APP_ID, SocialConstants.APP_SECRET));
    }
}
